/* 全局高度设置 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* 主容器样式 */
.resizable-container {
    display: flex;
    height: calc(100vh - 120px);
    min-height: 500px;
}

.left-panel {
    width: 50%;
    min-width: 300px;
    max-width: 70%;
    transition: none;
    height: 100%;
}

.right-panel {
    flex: 1;
    min-width: 300px;
    transition: none;
}

/* 拖拽把手样式 */
.resize-handle {
    width: 8px;
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    cursor: col-resize;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

.resize-handle:hover {
    background: linear-gradient(to bottom, #007bff, #0056b3);
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #6c757d;
    border-radius: 1px;
}

/* 结果容器样式 */
.result-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.result-top {
    height: 50%;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.result-bottom {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.result-resize-handle {
    height: 8px;
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    cursor: row-resize;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

.result-resize-handle:hover {
    background: linear-gradient(to right, #007bff, #0056b3);
}

.result-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 2px;
    width: 20px;
    background: #6c757d;
    border-radius: 1px;
}

/* JSON查看器样式 */
.json-viewer {
    background-color: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 5px;
    padding: 15px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
    position: relative;
    min-height: 0;
    max-height: none;
}

.json-viewer pre {
    margin: 0;
    background: transparent;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.json-viewer code {
    background: transparent;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* 自定义JSON语法高亮颜色 */
.json-viewer .token.property {
    color: #9cdcfe;
}

.json-viewer .token.string {
    color: #ce9178;
}

.json-viewer .token.number {
    color: #b5cea8;
}

.json-viewer .token.boolean {
    color: #569cd6;
}

.json-viewer .token.null {
    color: #569cd6;
}

.json-viewer .token.punctuation {
    color: #d4d4d4;
}

/* 按钮区域样式 */
.button-section {
    flex-shrink: 0;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    margin: 0 -15px -15px -15px;
    padding: 15px;
}

/* 通用样式 */
.loading {
    display: none;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
}

.card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.card-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    justify-content: space-between;
}

.textarea-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#messageInput {
    flex: 1;
    resize: none;
    min-height: 300px;
    max-height: calc(100vh - 400px);
}

.result-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
}

/* 复制按钮样式 */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.copy-btn:hover {
    opacity: 1;
}

.json-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* JSON表格样式 */
.json-table {
    font-size: 13px;
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
}

.json-table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    position: relative;
    user-select: none;
}

.json-table td {
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.json-table .table-primary {
    background-color: rgba(13, 110, 253, 0.1);
}

.json-table .table-primary td {
    border-color: rgba(13, 110, 253, 0.2);
}

.json-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* 列宽调整器样式 */
.column-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    z-index: 10;
}

.column-resizer:hover {
    background: rgba(0, 123, 255, 0.3);
}

.column-resizer.active {
    background: rgba(0, 123, 255, 0.5);
}

/* 表格容器样式 */
.table-container {
    position: relative;
    overflow-x: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .resizable-container {
        flex-direction: column;
        height: auto;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
        max-width: none;
    }
    
    .resize-handle {
        width: 100%;
        height: 8px;
        cursor: row-resize;
    }
    
    .resize-handle::after {
        width: 20px;
        height: 2px;
    }
    
    .json-table {
        font-size: 12px;
    }
    
    .json-table th,
    .json-table td {
        padding: 0.5rem 0.25rem;
    }
} 